home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Taifun / Taifun 099 (1989-05-15)(Ossowski, Stefan)(DE)(PD).zip / Taifun 099 (1989-05-15)(Ossowski, Stefan)(DE)(PD).adf / PCQ / Include / DOS.i next >
Text File  |  1989-03-31  |  4KB  |  137 lines

  1.  
  2.     { These are the definitions for the DOS library.  Note that a
  3.       couple routine names had to be changed since they conflict
  4.       with Pascal function names.
  5.  
  6.       Note, by the way, that you do not need to open the DOS library
  7.       before you use these.  The startup code requires the DOS, and
  8.       thus opens it, so the implementation for this library just uses
  9.       that pointer.  }
  10.  
  11.  
  12. const
  13.     ModeOldFile    = 1005;
  14.     ModeNewFile = 1006;
  15.  
  16.     OffsetBeginning = -1;
  17.     OffsetCurrent   =  0;
  18.     OffsetEnd       =  1;
  19.  
  20.     SharedLock      = -2;
  21.     ExclusiveLock   = -1;
  22.     AccessRead      = SharedLock;
  23.     AccessWrite     = ExclusiveLock;
  24.  
  25. type
  26.  
  27.     DateStampRec = record
  28.     dsDays   : Integer;
  29.     dsMinute : Integer;
  30.     dsTick   : Integer;
  31.     end;
  32.  
  33.     FileHandle = Address;
  34.     FileLock   = Address;
  35.     FileInfoBlock = record
  36.     fibDiskKey    : Integer;
  37.     fibDirEntryType    : Integer;
  38.     fibFileName    : Array [0..107] of Char;
  39.     fibProtection    : Integer;
  40.     fibEntryType    : Integer;
  41.     fibSize        : Integer;
  42.     fibNumBlocks    : Integer;
  43.     fibDate        : DateStampRec;
  44.     fibComment    : Array [0..115] of Char;
  45.     end;
  46.     FileInfoBlockPtr = ^FileInfoBlock;
  47.  
  48.     InfoData = record
  49.     idNumSoftErrors    : Integer;
  50.     idUnitNumber    : Integer;
  51.     idDiskState    : Integer;
  52.     idNumBlocks    : Integer;
  53.     idNumBlocksUsed    : Integer;
  54.     idBytesPerBlock    : Integer;
  55.     idDiskType    : Integer;
  56.     idVolumeNode    : Address;
  57.     idInUse        : Integer;
  58.     end;
  59.     InfoDataPtr = ^InfoData;
  60.  
  61.  
  62. { This first function is, of course, not an AmigaDOS function.  What
  63. it does is return the FileHandle of a normal PCQ file, in case you
  64. want to do a Seek() or some other DOS function on it.  If your file
  65. is a type other than Text, just modify this declaration (it doesn't
  66. actually matter what file type is used).
  67.     The only thing to keep in mind is that PCQ files always have the
  68. next element buffered.  Thus if you are going to mess with the file,
  69. you should get the buffered element ( using filevar^ ) then, after
  70. you have finished messing with it, fix the buffer with a call like
  71. 'get(filevar)'.  }
  72.  
  73. Function GetFileHandle(f : Text): FileHandle;
  74.     forward;
  75. Procedure DOSClose(f : FileHandle);
  76.     forward;
  77. Function CreateDir(s : String): FileLock;
  78.     forward;
  79. Function CurrentDir(l : FileLock): FileLock;
  80.     forward;
  81. Function DeleteFile(s : String): Boolean;
  82.     forward;
  83. Function DupLock(l : FileLock): FileLock;
  84.     forward;
  85. Function Examine(l : FileLock; f : FileInfoBlockPtr): Boolean;
  86.     forward;
  87. Function ExNext(l : FileLock; f : FileInfoBlockPtr): Boolean;
  88.     forward;
  89. Function Info(l : FileLock; i : InfoDataPtr): Boolean;
  90.     forward;
  91. Function Input() : FileHandle;
  92.     forward;
  93. Function IOErr() : Integer;
  94.     forward;
  95. Function IsInteractive(f : FileHandle): Boolean;
  96.     forward;
  97. Function Lock(s : String; a : Integer): FileLock;
  98.     forward;
  99. Function DOSOpen(s : String; a : Integer) : FileHandle;
  100.     forward;
  101. Function Output() : FileHandle;
  102.     forward;
  103. Function ParentDir(l : FileLock): FileLock;
  104.     forward;
  105. Function DOSRead(f : FileHandle; b : Address; l : Integer) : Integer;
  106.     forward;
  107. Function Rename(o, n : String) : Boolean;
  108.     forward;
  109. Function Seek(f : FileHandle; p : Integer; m : Integer) : Integer;
  110.     forward;
  111. Function SetComment(s, n : String): Boolean;
  112.     forward;
  113. Function SetProtection(s : String; m : Integer): Boolean;
  114.     forward;
  115. Procedure UnLock(l : FileLock);
  116.     forward;
  117. Function WaitForChar(f : FileHandle; t : Integer): Boolean;
  118.     forward;
  119. Function DOSWrite(f : FileHandle; b : Address; l : Integer) : Integer;
  120.     forward;
  121. Function CreateProc(n : String; p: Integer; s : Address; t : Integer): Integer;
  122.     forward;
  123. Procedure DateStamp(var v : DateStampRec);
  124.     forward;
  125. Procedure Delay(t : Integer);
  126.     forward;
  127. Function DeviceProc(n : String): Address;
  128.     forward;
  129. Procedure DOSExit(r : Integer);
  130.     forward;
  131. Function Execute(s : String; i, o : FileHandle): Boolean;
  132.     forward;
  133. Function LoadSeg(n : String): Address;
  134.     forward;
  135. Procedure UnLoadSeg(s : Address);
  136.     forward;
  137.